package org.project.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

/**
 * swagger配置类
 *
 * @Auther: hzy
 * @Date: 2022/4/11
 * @Description:
 */

@Configuration
public class SwaggerConfig {
    private final String Title = "服务外包";
    private final String URL = "";
    private final String Email = "422511186@qq.com";


    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.OAS_30)
                .select()
                .apis(RequestHandlerSelectors.any())
                .paths(PathSelectors.regex("(?!/error.*).*"))
                .build()
                .apiInfo(new ApiInfoBuilder()
                        .contact(new Contact("hzy", URL, Email))
                        .title(Title)
                        .version("1.0")
                        .build()
                );
    }
}
